<template>
  <div>
    <el-table :data="tableData.list" v-loading="listLoading" border size="small">
      <el-table-column
        label="股东名称"
        prop="shareholderName"
        align="center"
      ></el-table-column>
      <el-table-column
        label="认缴出资额"
        prop="subscribedCapital"
        align="center"
      ></el-table-column>
      <el-table-column
        label="认缴出资时间"
        prop="shoudDate"
        align="center"
      ></el-table-column>
      <el-table-column
        label="占股比例"
        prop="shareholdingRatio"
        align="center"
      ></el-table-column>
      <el-table-column
        label="首次持股时间"
        prop="capiDate"
        align="center"
      ></el-table-column>
      <el-table-column
        label="最终受益股份"
        prop="finalBenefitPercent"
        align="center"
      ></el-table-column>
      <el-table-column
        label="职位"
        prop="position"
        align="center"
      ></el-table-column>
    </el-table>
    <el-pagination
      class="pageRight"
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :page-sizes="[10, 20, 30, 40]"
      :current-page="searchForm.pageNum"
      :page-size="searchForm.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="tableData.total"
    >
    </el-pagination>
  </div>
</template>

<script>
import { GetEnterprisePartners } from "@/api/campanyData";
export default {
  data() {
    return {
      listLoading: false,
      searchForm: {
        creditCode: "",
        pinyin: "",
        pageSize: 10,
        pageNum: 1,
      },
      tableData: {
        list: [],
        total: 0,
      },
    };
  },
  props: {
    initObj: {
      type: Object,
      default: () => false,
    },
    pinyin: {
      default: () => false,
    },
  },
  created() {
    this.getInfo();
  },
  mounted() {},
  methods: {
    handleSizeChange(val) {
      this.searchForm.pageSize = val;
      this.getInfo();
    },
    handleCurrentChange(val) {
      this.searchForm.pageNum = val;
      this.getInfo();
    },

    getInfo() {
      this.searchForm.creditCode = this.initObj.taxNumber;
      this.searchForm.pinyin = this.pinyin;
      this.listLoading = true;
      GetEnterprisePartners(this.searchForm)
        .then((res) => {

          this.tableData.list = res.data.list;
          this.tableData.total = res.data.total;
          this.listLoading = false;
        })
        .finally(() => {
          this.listLoading = false;
          this.listLoading = false;
        });
    },
  },
};
</script>

<style lang="scss" scoped>
/deep/ .el-dialog__title {
  color: #222222;
  font-size: 16px;
  font-weight: 500;
}
.title {
  font-weight: 500;
  font-size: 18px;
  color: #222222;
  margin-bottom: 20px;
}
.left {
  width: 50%;
  margin-right: 30px;
  .labelItem {
    text-align: center;
    padding: 15px 0;
    background: #f5f5f5;
    color: #222222;
    span {
      color: #999999;
    }
  }
  .label {
    text-align: center;
    padding: 15px 0;
    color: #222222;
    span {
      color: #999999;
    }
  }
}
.right {
  width: 50%;
  .labelItem {
    text-align: center;
    padding: 15px 0;
    background: #f5f5f5;
    color: #222222;
    span {
      color: #999999;
    }
  }
  .label {
    text-align: center;
    padding: 15px 0;
    color: #222222;
    span {
      color: #999999;
    }
  }
}

.detail {
  /deep/ .el-dialog__body {
    padding-left: 90px;
  }
  /deep/ .el-form-item__label {
    color: #222222;
    font-weight: 400;
    font-size: 16px;
  }
  /deep/ .el-form-item__content {
    color: #222222;
    font-size: 16px;
  }
}
</style>
